NAND flash memory, as well as other types of non-volatile memories (“NVMs”), are commonly used for mass storage. For example, electronic devices such as portable media players or cellular telephones often include raw flash memory or a flash card to store music, videos, and other media.
The NVM may include one or more blocks for storing data. Each block can correlate to a particular logical range in a logical space, sometimes referred to as a “logical block”, which can be allocated to one or more files. For example, pages of a block can store data corresponding to particular sectors of a logical block. In some cases, a memory interface of the electronic device can map logical addresses provided by a file system to corresponding physical addresses where data is stored in one or more pages of a block.
In some systems, two different types of blocks may be used to store data. One type, referred to as “data blocks”, can be used to provide long-term storage of data. Although read and erase operations can be performed on these data blocks, programming operations can no longer be performed. In contrast, a second type, referred to as “log blocks”, can serve as temporary storage for new data that is being programmed to the NVM. In particular, the use of log blocks can reduce write amplification when a system performs file allocation table (“FAT”) updates.
Due to storage space constraints, a memory interface may need to eventually reclaim or garbage collect one or more log blocks in order to reclaim space on the NVM. In order to reclaim these log blocks, the memory interface may need to merge a log block with a data block by copying the newest version of data into a new block. Once the merge has completed, the memory interface can erase the log and data blocks. Unfortunately, these memory operations can negatively impact system efficiency and increase memory wear over time, especially when regular writes are being performed on a fragmented logical space.